﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO;
using System.Text;

namespace ANLP.ANTLR.LexerGenerator
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            StringBuilder sb = new StringBuilder();

            Lexer.LexerGenerator.Generate(new StringReader(@"%Namespace ANLP.ANTLR
%Visibility public
'                       { return (int)Tokens.Quotes; }
:                       { return (int)Tokens.Colon; }
\*                      { return (int)Tokens.Star; }
\?                      { return (int)Tokens.QuestionMark; }
\+                      { return (int)Tokens.Plus; }
returns                 { return (int)Tokens.Returns; }
\|                      { return (int)Tokens.Pipe; }
;                       { return (int)Tokens.SemiColon; }
[A-Za-z][A-Za-z0-9]+    { return (int)Tokens.Identifier; }
[ \t\r\f\v] { return (int)Tokens.Whitespace; }"), new StringWriter(sb));
            output.Text = sb.ToString();

        }
    }
}
